<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" http-equiv="Content-Type" content="text/html">
    <meta name="referrer" content="no-referrer" />
    <title>论坛</title>

    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css"
          integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"
            integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
            crossorigin="anonymous"></script>
    <link rel="stylesheet" href="css/community.css" >
</head>

<body>
    <div th:insert="~{navigation :: nav}"></div>

    <div class="container-fluid main">
        <div class="row">
            <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
                <h2 ><span class="glyphicon glyphicon-list" aria-hidden="true"></span>发现</h2>
                <hr>

                <div class="media" th:each="question: ${questions.items}">
                    <div class="media-left">
                        <a th:href="@{'/questionDetails/'+${question.id}}">
                            <!-- http://b-ssl.duitang.com/uploads/item/201704/10/20170410095843_SEvMy.thumb.700_0.jpeg -->
                            <img class="media-object img-circle" th:src="${question.user.avatarUrl}">
                        </a>
                    </div>
                    <div class="media-body">
                        <h4 class="media-heading">
                            <a th:href="@{'questionDetails/'+${question.id}}" th:text="${question.title}"></a>
                        </h4>
                        点击xxx<br>
                        <span class="text-desc"><span th:text="${question.commentCount}">评论</span>, <span
                                th:text="${question.viewCount}"></span> 浏览,
                            <span th:text="${#dates.format(question.gmtCreate,'yyyy-MM-dd HH:mm')}"></span>发布的</span>
                    </div>
                </div>
<!--                <span th:text="${questions}"></span>-->
                <nav aria-label="Page navigation">
                    <ul class="pagination">
                        <li th:if="${questions?.showFirstPage}">
                            <a th:href="@{/(page=1,search=${search})}" aria-label="Previous">
                                <span aria-hidden="true">&lt;&lt;</span>
                            </a>
                        </li>
                        <li th:if="${questions?.showPrevious}">
                            <a th:href="@{/(page=${questions.current-1},search=${search})}" aria-label="Previous">
                                <span aria-hidden="true">&lt;</span>
                            </a>
                        </li>


                        <li th:each="page : ${questions?.pages}" th:class="${questions.current == page} ? 'active' : ''">
                            <a  th:href="@{/(page=${page},search=${search})}" th:text="${page}"></a>
                        </li>


                        <li th:if="${questions?.showNext}">
                            <a th:href="@{/(page=${questions.current+1},search=${search})}" aria-label="Next">
                                <span aria-hidden="true">&gt;</span>
                            </a>
                        </li>
                        <li th:if="${questions?.showEndPage}">
                            <a th:href="@{/(page=${questions.total},search=${search})}" aria-label="Next">
                                <span aria-hidden="true">&gt;&gt;</span>
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
            <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12" >
                <h3>热门话题</h3>
            </div>
        </div>
    </div>
</body>
</html>